<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ctrl="clr-namespace:Hockey.UILayer.Controls">
        
    <Style TargetType="{x:Type ctrl:ArrowButton}">
        <!--Button-->
            <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
            <Setter Property="Background" Value="{DynamicResource WindowBackgroundBrush}" />
            <Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
            <Setter Property="BorderThickness" Value="1,1,1,1" />
            <Setter Property="Padding" Value="8,3" />

            <Setter Property="Template">
                <Setter.Value>
                <ControlTemplate TargetType="{x:Type ctrl:ArrowButton}">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="HasFocus" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="00:00:00.2000000" />
                                        <VisualTransition From="MouseOver" GeneratedDuration="00:00:00" To="Pressed" />
                                        <VisualTransition From="Pressed" GeneratedDuration="00:00:00" />
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0.5" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                <SplineThicknessKeyFrame KeyTime="0" Value="2.5,2.5,0.5,0.5" />
                                            </ThicknessAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Normal" />
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <ThicknessAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="Background" Storyboard.TargetProperty="(Border.BorderThickness)">
                                                <SplineThicknessKeyFrame KeyTime="0" Value="0.5,0.5,0.5,0.5" />
                                            </ThicknessAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="InnerShadow" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0.65" />
                                            </DoubleAnimationUsingKeyFrames>
                                            <DoubleAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="0.35" />
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="Background" CornerRadius="12" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="0.5,0.5,1.5,1.5" />
                            <Grid x:Name="InnerShadow" Grid.RowSpan="2" Grid.ColumnSpan="2">
                                <Border x:Name="BottomShadow" Background="{TemplateBinding BorderBrush}" CornerRadius="12" OpacityMask="{StaticResource BottomShadowMask}" />
                                <Border x:Name="Halo" CornerRadius="12" Background="{TemplateBinding BorderBrush}" OpacityMask="{StaticResource HaloMask}" />
                            </Grid>
                            <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" RenderTransformOrigin="0.5,0.5">
                                <ContentPresenter.RenderTransform>
                                    <TransformGroup>
                                        <TranslateTransform />
                                    </TransformGroup>
                                </ContentPresenter.RenderTransform>
                            </ContentPresenter>
                            <Border x:Name="HasFocus" CornerRadius="13" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" Margin="-3" Visibility="Collapsed" OpacityMask="{StaticResource FocusMask}" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter Property="BorderThickness" TargetName="Background" Value="0.5,0.5,0.5,0.5" />
                                <Setter Property="Opacity" TargetName="InnerShadow" Value="0.65" />
                                <Setter Property="Opacity" TargetName="contentPresenter" Value="0.35" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
    </Style>      
</ResourceDictionary>
